﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using MP3Ganizer.Common.Interfaces.Infrastructure;

namespace MP3Ganizer.Common.Services.Infrastructure
{
    public class CommandPanelClientManager : IManageCommandPanel
    {
        private CommandPanelClientManagerFactory _factory;
        public CommandPanelClientManager()
        {
            _factory = new CommandPanelClientManagerFactory();
        }


        public bool TryToBuildACommandPanelByType(object value, out IAmACommandPanel panel)
        {
            IBuildCommandPanel builder;
            if(_factory.TryToGetBuilder(value, out builder))
            {
                panel = builder.TryToBuildACommandPanel();
                return true;
            }
            panel = null;
            return false;
        }
    }
}
